<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\HomeBaseController;

class IndexController extends HomeBaseController
{
    public function index()
    {
        // $redis = new \Redis();
        // $redis->connect('127.0.0.1',6379);
        // $redis->watch('xiaolv');
        // // $redis->multi();
        // $nums = $redis->get('xiaolv');
        // dump($nums);die;
        // $num = 3;
        // // if ($nums >= $num) {
        // //     echo "库存不足";
        // // }
        // $redis->incr('xiaolv');
        // $redis->exec();

        return $this->fetch(':index');
    }
    
    //定时任务
    public function task(){
        file_put_contents('1.log', date('Y-m-d H:i:s')."我是定时任务\r\n",FILE_APPEND);die;
    }
}
